package com.newer.service.sys.iter;

import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.apache.ibatis.annotations.Param;

import com.newer.pojo.sys.Organization;
import com.newer.pojo.sys.OrganizationExample;
import com.newer.pojo.sys.Role;
import com.newer.pojo.sys.RoleExample;
import com.newer.pojo.sys.User;
import com.newer.pojo.sys.UserExample;
import com.newer.pojo.sys.UserRole;
import com.newer.utils.sys.BootstrapDataTable;
import com.newer.utils.sys.Conditions;
import com.newer.utils.sys.MsgUtil;
import com.newer.utils.sys.SuggestUtil;

public interface UserService {
	
	int add(User user);
	
	BootstrapDataTable tableView(BootstrapDataTable dataTable,Conditions conditions);
	
	User selectByPrimaryKey(Integer userid);
	
	List<Role> seleteRole(RoleExample example);
	
	List<Organization> seleteOrganization(OrganizationExample example);
	
	Map<String, Boolean> seleclUserByUserName(String userName);
	
	Map<String, Boolean> seleclUserByTelephone(String userName, Integer id);
	
	int updatePassword(String password,String newPassword,Integer id);
	
	int deleteUser(User user);
	
	int deleteUserByIds(String Ids);
	
	int updateUser(User user);
	
	List<UserRole> selectUserRoles(Integer userId);
	
	
	int countByExample(UserExample example);

	int deleteByExample(UserExample example);

	int deleteByPrimaryKey(Integer userid);

	int insert(User record);

	int insertSelective(User record);

	int updateByExampleSelective(@Param("record") User record, @Param("example") UserExample example);

	int updateByExample(@Param("record") User record, @Param("example") UserExample example);

	int updateByPrimaryKeySelective(User record);

	int updateByPrimaryKey(User record);

	SuggestUtil selectSuggest(Conditions conditions);

	/**
	 * 根据用户名查询到该用户
	 * @param principal
	 * @return
	 */
	User getByUserName(String principal);
	

}
